﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using DSheet.Core.Data;
using DSheet.Core;

namespace DExcelServiceApp
{
    public partial class DocList : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            using (DBContext context = new DBContext())
            {
                SessionData sd = Session["sd"] as SessionData;

                List<DocInstance> instances = new DocInstanceService().GetAllInstance(context, sd.YearID, sd.BDID, sd.ORGID);
                _ctlListDoc.DataSource = instances;
                _ctlListDoc.DataBind();

                List<DocTemplate> datas = new DocDefService().GetTemplates(context, sd.YearID, sd.BDID, sd.ORGID);
                _ctlListTemplate.DataSource = datas;
                _ctlListTemplate.DataBind();
            }
        }
    }
}